package com.sparrow.rpc.socket.msg.req;

import com.sparrow.rpc.socket.msg.RpcCodecMsg;
import com.sparrow.rpc.socket.msg.RpcMsgType;

import java.io.Serializable;

/**
 * 节点登录请求
 */
public class RpcLoginRequest implements RpcCodecMsg, Serializable {
    private static final long serialVersionUID = 1L;

    private String nodeId;
    private String ip;
    private int port;

    public RpcLoginRequest() {

    }

    public RpcLoginRequest(String nodeId, String ip, int port) {
        this.nodeId = nodeId;
        this.ip = ip;
        this.port = port;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    @Override
    public int getType() {
        return RpcMsgType.LOGIN_REQ.getTypeId();
    }
}
